Skip to content

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Oct 22, 2025

PR Description

Simple implementation (more of a skeleton) for fork_choice#on_execution_payload. Also created a new ForkChoicePayloadExecutorGloas which is catered for Gloas.

Fixed Issue(s)

related to #9878

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Note

Implements the fork choice on_execution_payload path using a new Gloas payload executor, extends import results and logging/debug utilities, and adapts APIs to use Optional headers.

  • Fork Choice:
    • Implement onExecutionPayload to retrieve state by slot+block_root, process/verify payload, run DA check (NOOP for now), execute via ForkChoicePayloadExecutorGloas, and commit to store.
    • Add importExecutionPayloadAndState flow and invalid execution payload reporting.
    • Add ForkChoiceUtil.applyExecutionPayloadToStore (no-op; Gloas override placeholder).
  • Execution Payload Processing (Gloas/Bellatrix):
    • Create ForkChoicePayloadExecutorGloas to submit engine_newPayload and track results.
    • Update OptimisticExecutionPayloadExecutor.optimisticallyExecute to accept Optional<ExecutionPayloadHeader> and update all callers (Bellatrix, Gloas, forkchoice executor/tests).
    • Gloas processor now passes Optional.empty() and validates envelope as before.
  • Data Structures & Results:
    • Add getSlot() and getSlotAndBlockRoot() to SignedExecutionPayloadEnvelope.
    • Expand ExecutionPayloadImportResult with new failure reasons (UNKNOWN_BEACON_BLOCK_ROOT, FAILED_EXECUTION, DA failures) and factory helpers.
    • AvailabilityChecker tweaks: constants and javadoc updated to Optional method signature.
  • Debugging & Logging:
    • DebugDataDumper/DebugDataFileDumper: support saving invalid execution payloads; refine data column sidecar saving.
    • P2PLogger: add onInvalidExecutionPayload.
  • Tests:
    • Add ForkChoicePayloadExecutorGloasTest and update existing tests for Optional header API and file dumper behavior.

Written by Cursor Bugbot for commit c03126f. This will update automatically on new commits. Configure here.

}

public void applyExecutionPayloadToStore(
final MutableStore store,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'store' is never used.

public void applyExecutionPayloadToStore(
final MutableStore store,
final SignedExecutionPayloadEnvelope signedEnvelope,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'signedEnvelope' is never used.
public void applyExecutionPayloadToStore(
final MutableStore store,
final SignedExecutionPayloadEnvelope signedEnvelope,
final BeaconState postState) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'postState' is never used.
@StefanBratanov StefanBratanov force-pushed the fork_choice_on_execution_payload_skeleton branch from 1b06696 to c03126f Compare October 23, 2025 06:29
@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Optimistic Execution Fails on Empty Optional

The optimisticallyExecute method expects an Optional<ExecutionPayloadHeader> but immediately calls orElseThrow(). This throws a NoSuchElementException if the Optional is empty, which is now possible from the caller in BlockProcessorBellatrix.java and can occur during merge transition.

Fix in Cursor Fix in Web

@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Missing Directory Creation in DebugDataFileDumper

The DebugDataFileDumper constructor is missing the createDirectory call for INVALID_EXECUTION_PAYLOAD_DIR. This differs from how other invalid data directories are set up and could cause issues when saving invalid execution payloads.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant